]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Discard invalid sized areas
authorAdel Gadllah <adel.gadllah@gmail.com>
Sat, 2 Mar 2013 13:59:05 +0000 (14:59 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Sat, 2 Mar 2013 21:26:27 +0000 (22:26 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=694998

js/ui/screenshot.js

index 5537bf1551210af27e026b40a0e1a3ff5615946b..2219a890f5e717ef194edee6826300fdc26edcc4 100644 (file)
@@ -76,6 +76,11 @@ const ScreenshotService = new Lang.Class({
 
     ScreenshotAreaAsync : function (params, invocation) {
         let [x, y, width, height, flash, filename, callback] = params;
+        if (height <= 0 || width <= 0) {
+            invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
+                        "Invalid params");
+            return;
+        }
         let screenshot = new Shell.Screenshot();
         screenshot.screenshot_area (x, y, width, height, filename,
                                 Lang.bind(this, this._onScreenshotComplete,